package com.jingsong.studentapp.adapter;
/*
 * @author zei , QQ:77132995, email:kazeik@163.com
 * 2021-12-18 18:17
 * 类说明:
 */

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

public class LessonAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;

    public LessonAdapter(@NonNull FragmentManager fm, List<Fragment> fragmentList) {
        super(fm);
        this.fragments = fragmentList;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments == null || fragments.isEmpty() ? 0 : fragments.size();
    }
}
